<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <%@ include file="/taglibs.jsp"%>
    <title>上传</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <script type="text/javascript">
    	var companyId='<%=request.getParameter("companyId")%>' ;
  		function fileUpload(){
  			var filename=document.uploadform.fileName.value;
  			if(filename==''){
  				alert('选择文件');
  				return;
  			}
  			if(document.getElementById('picName').value==null||document.getElementById('picName').value==''){
  				alert("输入图片名称");
  				return;
  			}
  			var types=filename.split('.');
  			var type=types[types.length-1]
  			if(type!='jpg' && type!='JPG' && type!='png' && type!='PNG' && type!='GIF' && type!='gif'){
  				alert('请选择图片');
  				return;
  			}
  			var url="<%=path%>/classify/uploadCompanyPic.do?fileName="+filename+"&companyId="+companyId;
  			var form=document.uploadform;
  			form.action=url;
  			form.submit();
  		}
  		function winclose(){
  			window.close();
  		}
  	</script>
  	<div >
  		<form action="" name="uploadform" method="post" enctype="multipart/form-data" >
  			图片名称：<input type='text' name='picName' id='picName'><br>
  			显示顺序：<input type='text' name='displayOrder' id='displayOrder'>
  			<s:file name="fileName"/>
  			<input type='button' value="上传" name="upload" onclick="fileUpload();"/>
  			<input type='button' value="关闭" name="close" onclick="winclose();"/>
  		</form>
  	</div>
  	<style>
		body {
		margin: 0;
		padding: 0 0 12px 0;
		font-size: 12px;
		line-height: 22px;
		font-family: "宋体", "Arial Narrow";
		background: #fff;
	}
  </body>
</html>
